import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';
//配件类型维护-主机厂
//配件类型维护查询-主页面查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/getListByPage`, params);
//新增弹窗-数据保存
export const newSave = params => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/saveOne`, params);
//主页面的单条删除
export const deleteOne = (id, params) => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/updateStatusById/${id}`,{params} );
//配件类型查询
export const selectListByPage = params => axios.get(`${SERVER.CLAIMFAC}/rPPtType/getListByPage`,params);
//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMFAC}/rpQaUrgentDtl/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/getListForExport`, params, {
  responseType: 'blob'
});
  //下载中心导出
  export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);


//导出
export const getListForExportIssue = (params) => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/getListForExportIssue`, params, {
  responseType: 'blob'
});
//导出
export const getListForExportOutbound= (params) => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/getListForExportOutbound`, params, {
  responseType: 'blob'
});

//字典
export const getPartType = (params) => axios.get(`${SERVER.CLAIMFAC}/const/getBaseDataByType`, {params});

//获取配件
export const getPartList = params =>
  axios.get(`${SERVER.CLAIMFAC}/const/getPartList`, {
    params
  });
//编辑回显
export const quyUrgent = params => axios.get(`${SERVER.CLAIMFAC}/rpQaUrgent/selectById/${params.id}`);
//一般车辆配件类型保修期编辑弹窗的保存
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/updateByPtId`,  params );

export const getShList = params => axios.post(`${SERVER.CLAIMFAC}/rPQaReportLog/getListByPage`,  params );

export const getCaseList = params => axios.post(`${SERVER.CLAIMFAC}/rPQaCase/getListByPage`, params);

export const approveByPtId = params => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/approveByPtId`, params);

export const splitByPtId = params => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/splitByPtId`, params);

export const getReList = params => axios.post(`${SERVER.CLAIMFAC}/urgentReceiver/getListByPage`, params);

export const saveRe = params => axios.post(`${SERVER.CLAIMFAC}/urgentReceiver/saveOne`, params);

export const selectByIdList = params => axios.post(`${SERVER.CLAIMFAC}/urgentReceiver/selectByIdList`, params);

//新增弹窗-数据保存
export const newSaveEle = params => axios.post(`${SERVER.CLAIMFAC}/rPReturnJf/add`, params);

export const piliangBack= data => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/updateBackByIds`, null,{params:data});
export const piliangDown= data => axios.post(`${SERVER.CLAIMFAC}/rpQaUrgent/updateDownByIds`, null,{params:data});


